import { lazy } from 'react'
import { Navigate } from 'react-router-dom'

const Discover = lazy(() => import('@/views/discover'))
const Mine = lazy(() => import('@/views/mine'))
const Follow = lazy(() => import('@/views/follow'))
const Product = lazy(() => import('@/views/product'))
const ArtList = lazy(() => import('@/views/artlist'))
const Song = lazy(() => import('@/views/song'))
const DownLoad = lazy(() => import('@/views/download'))

const Album = lazy(() => import('@/views/discover/c-views/album'))
const Artist = lazy(() => import('@/views/discover/c-views/artist'))
const Djradio = lazy(() => import('@/views/discover/c-views/djradio'))
const Ranking = lazy(() => import('@/views/discover/c-views/ranking'))
const Recommend = lazy(() => import('@/views/discover/c-views/recommend'))
const Songs = lazy(() => import('@/views/discover/c-views/songs'))

const SongDetail = lazy(() => import('@/views/songDetail'))

const routes = [
  {
    path: '/',
    element: <Navigate to="/discover"/>,
  },
  {
    path: '/discover',
    element: <Discover />,
    children: [
      {
        path: '/discover',
        element: <Navigate to="/discover/recommend"/>,
      },
      {
        path: '/discover/recommend',
        element:<Recommend></Recommend>,
      },
      {
        path: '/discover/ranking',
        element:<Ranking></Ranking>,
      },
      {
        path: '/discover/songs',
        element:<Songs></Songs>,
      },
      {
        path: '/discover/djradio',
        element:<Djradio></Djradio>,
      },
      {
        path: '/discover/artist',
        element:<Artist></Artist>,
      },
      {
        path: '/discover/album',
        element:<Album></Album>,
      },
      {
        path:'/discover/songDetail',
        element: <SongDetail></SongDetail>
      }
    ]
  },
  {
    path: '/mine',
    element: <Mine />,
  },
  {
    path: '/follow',
    element: <Follow />,
  },
  {
    path: '/product',
    element: <Product />,
  },
  {
    path: '/artlist',
    element: <ArtList />,
  },
  {
    path: '/song',
    element: <Song />,
  },
  {
    path: '/download',
    element: <DownLoad />,
  }
]

export default routes